let arr = [1, 2, 3, 8];
console.log(arr.flatMap(x => [x * 2 + 1]));
/* 结果
[ 3, 5, 7, 17 ]
*/

let strArr = ["hello world", "hey man, you are good"];
console.log(strArr.flatMap(x => x.split(" ")));
/* 结果
[ "hello", "world", "hey", "man,", "you", "are", "good" ]
*/
console.log(arr);